package edu.pku.sei.transformation.tgg.adapter;

import java.util.ArrayList;
import java.util.List;

import edu.pku.sei.modeler.model.core.MetaNamedElement;
import edu.pku.sei.transformation.editor.model.MetaModel;
import edu.pku.sei.transformation.editor.model.variable.ObjectVariable;
import edu.pku.sei.transformation.tgg.rule.IDomain;
import edu.pku.sei.transformation.tgg.rule.IEdge;
import edu.pku.sei.transformation.tgg.rule.INode;
import edu.pku.sei.transformation.tgg.rule.IPattern;

public class NodeAdapter implements INode {
	protected ObjectVariable element;
	List<IEdge> list = new ArrayList<IEdge>();
	IPattern owner;
	IDomain domain;
	public NodeAdapter(ObjectVariable element, IPattern owner, IDomain doamin) {
		this.element = element;
		this.domain = doamin;
		this.owner = owner;
	}
	
	@Override
	public List<IEdge> getOutGoingEdges() {
		return list;
	}

	@Override
	public String getType() {
		MetaModel model = (MetaModel) element.getType().getModel();
		return model.getFilePath()+"#//"+((MetaNamedElement)element.getType()).getName();
	}

	@Override
	public IPattern getPattern() {
		return owner;
	}

	@Override
	public String getID() {
		return String.valueOf(element.getElementID());
	}
	
	@Override
	public IDomain getDomain() {
		return domain;
	}

}
